#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::on_accept_clicked()
{
    ui->label->setText("noting");
}


void Widget::on_reject_clicked()
{
    int width=this->geometry().width();
    int height=this->geometry().height();
    int nx=ui->accept->geometry().x();
    int ny=ui->accept->geometry().y();
    int x,y;
    do{
        x=rand()%width;
        y=rand()%height;
    }while(x==nx&&y==ny);
    ui->reject->move(x,y);


}


void Widget::on_reject_pressed()
{
    int width=this->geometry().width();
    int height=this->geometry().height();
    int nx=ui->accept->geometry().x();
    int ny=ui->accept->geometry().y();
    int x,y;
    do{
        x=rand()%width;
        y=rand()%height;
    }while(x==nx&&y==ny);
    ui->reject->move(x,y);

}

